N            equ  8



             org  $1000
             move.b alpha,d0  ; d0 is data
             move.b #0,d1     ; d1 is bit counter
             move.b #N-1,d2   ; d2 is loop counter
x2           lsr.b  #1,d0
             bcc   x3
             add.b #1,d1
x3           dbra  d2,x2
             move.b d1,count1
             nop

              org  $10a0
alpha         ds.b 1
count1        ds.b 1


even parity
x0011010     10011010
x0110011     00110011


odd parity
x0111001     10111001
x1100100     01100100









